package cn.zhf.shop.service.impl;

import cn.zhf.shop.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import cn.zhf.shop.entity.ServicePhone;
import cn.zhf.shop.mapper.ServicePhoneMapper;
import cn.zhf.shop.service.ServicePhoneService;

import java.util.List;

@Service
public class ServicePhoneServiceImpl implements ServicePhoneService{

    @Resource
    private ServicePhoneMapper servicePhoneMapper;

    @Override
    public Message deleteByPrimaryKey(Integer servicePhoneId) {
        return servicePhoneMapper.deleteByPrimaryKey(servicePhoneId)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insert(ServicePhone record) {
        return servicePhoneMapper.insert(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message insertSelective(ServicePhone record) {
        return servicePhoneMapper.insertSelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message<ServicePhone> selectByPrimaryKey(Integer servicePhoneId) {
        return Message.success(null).add(servicePhoneMapper.selectByPrimaryKey(servicePhoneId));
    }

    @Override
    public Message updateByPrimaryKeySelective(ServicePhone record) {
        return servicePhoneMapper.updateByPrimaryKeySelective(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message updateByPrimaryKey(ServicePhone record) {
        return servicePhoneMapper.updateByPrimaryKey(record)>0?Message.success(null):Message.fail(null);
    }

    @Override
    public Message<List<ServicePhone>> selectAll() {
        return Message.success(null).add(servicePhoneMapper.selectAll());
    }

}
